package main

import (
	"net/http"
	"fmt"
	"strings"
)

func main() {

	http.HandleFunc("/", index)
	http.ListenAndServe(":9999", nil)

}

func index(rw http.ResponseWriter, r *http.Request)  {
	//r.ParseForm()
	name := r.Form.Get("name")
	name = r.FormValue("name")
	fmt.Println("path", r.URL.Path)
	fmt.Println("scheme", r.URL.Scheme)
	fmt.Println(r.Form["url_long"])
	for k, v := range r.Form {
		fmt.Println("key:", k)
		fmt.Println("val:", strings.Join(v, ":"))
	}
	fmt.Fprintf(rw, "Hello World  -- %s", name)
}

